Skip to main content
Version: 3.x.x

FetchParamsType


import { FetchParamsType } from "@hyper-fetch/core"

Description

If the request endpoint parameters are not filled it will throw an error

Defined in request/request.types.ts:229

Preview

type FetchParamsType<Endpoint,HasParams> = ExtractRouteParams<Endpoint> extends NegativeTypes ? { params?: NegativeTypes } : HasParams extends true ? { params?: NegativeTypes } : { params: NonNullable<ExtractRouteParams<Endpoint>> };

Structure

ExtractRouteParams<Endpoint> extends NegativeTypes ? {
params: NegativeTypes;
} : (HasParams extends true ? {
params: NegativeTypes;
} : {
params: NonNullable<ExtractRouteParams<Endpoint>>;
})